import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        list:[]
    },
    mutations: {
        getUserData(state,arr){
            state.list = arr
        }
    },
    actions:{
        getList({commit}){
            axios.get('http://localhost/api.php/jqsystems?transform=1')
            .then( res =>{
               commit('getUserData',res.data.jqsystems)
            })
        }
    }
})
export default store